﻿using System.Windows;
using System.Windows.Controls;
using Launch.ViewModel;

namespace Launch.Views;

public partial class TestStackView : UserControl
{
    // ViewModel
    private readonly TestStackVm _vm = new();

    // 当前的页面集合
    private List<object> _pages = new();

    public TestStackView()
    {
        InitializeComponent();
        DataContext = _vm;

        _pages.Add(new Page0());
        _pages.Add(new Page1());
        
        _vm.CurPage = _pages[0];
    }

    private void BtnSelectPage0(object sender, RoutedEventArgs e)
    {
        _vm.CurPage = _pages[0];
    }

    private void BtnSelectPage1(object sender, RoutedEventArgs e)
    {
        _vm.CurPage = _pages[1];
    }
}